[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Pre-defined constant flags for INPUTSTR and PROMPTSTR

 Functions
  If the flags are set they mean the following:

   AUTO        Auto press enter after 20 seconds of no user input
   ECHODOTS    Echo dots instead of user input
   ERASELINE   Erase the current line when user presses enter

   FIELDLEN    Display "()" to show input field width if ANSI enabled
   GUIDE       Display "()" for FIELDLEN if ANSI not enabled
   HIGHASCII   Allow high ascii characters as input

   LFAFTER     Send an extra line feed after user presses enter
   LFBEFORE    Send an extra line feed before prompt display
   NEWLINE     Send a line feed after user presses enter

   NOCLEAR     Don't clear field at first keypress regardless of ANSI
   STACKED     Allow semi-colons and spaces to be input
   UPCASE      Force user input to upper case

   WORDWRAP    Save the text at the end of the line
   YESNO       Only allow international yes/no responses

 Value
  AUTO      = 8192 = 10000000000000b = 20000o = 2000h
  ECHODOTS  = 1    = 1b              = 1o     = 1h
  ERASELINE = 32   = 100000b         = 40o    = 20h

  FIELDLEN  = 2    = 10b            = 2o     = 2h
  GUIDE     = 4    = 100b           = 4o     = 4h
  HIGHASCII = 4096 = 1000000000000b = 10000o = 1000h

  LFAFTER   = 256 = 100000000b = 400o = 100h
  LFBEFORE  = 128 = 10000000b  = 200o = 80h
  NEWLINE   = 64  = 1000000b   = 100o = 40h

  NOCLEAR   = 1024 = 10000000000b = 2000o = 400h
  STACKED   = 16   = 10000b       = 20o   = 10h
  UPCASE    = 8    = 1000b        = 10o   = 8h

  WORDWRAP  = 512   = 1000000000b      = 1000o  = 200h
  YESNO     = 16384 = 100000000000000b = 40000o = 4000h

 Remarks
  AUTO        INPUTSTR and PROMPTSTR have the ability to automatically
              answer themselves if left alone for 20 seconds.  This can be
              especially useful if you are writing a program that should
              work with automated systems; use the AUTO constant and the
              question will automatically be answered after 20 seconds
              just in case the automation system doesn't know what to do
              with it.

  ECHODOTS    INPUTSTR and PROMPTSTR have the ability to disable echoing
              of user input and instead echo dots in place of the user's
              input.  This is useful in situations where the information
              being entered is confidential and shouldn't be revealed to
              any other party.  A good example of this is the user's
              password.

  ERASELINE   INPUTSTR and PROMPTSTR have the ability to erase the current
              line after the user presses ENTER.  This is the technique
              used by the MORE and WAIT statements to clean up after
              themselves.

  FIELDLEN    INPUTSTR and PROMPTSTR have the ability to display the
              length of an input field using "()" if the user has ANSI
              available.  If you want to ensure that the user knows how
              wide the input area is regardless of ANSI support being
              available, also use the GUIDE flag.

  GUIDE       INPUTSTR and PROMPTSTR have the ability to display the
              length of an input field, regardless of ANSI availability,
              if you use this constant with the FIELDLEN constant. If ANSI
              is not available and this constant is used, the user will
              see the input field width marked using "(---)" above the
              input field.

  HIGHASCII   INPUTSTR and PROMPTSTR have the ability to allow high ASCII
              characters to be input regardless of the valid character
              string specified, but only if the SysOp has disabled the
              high ASCII filter in PCBSetup.

  LFAFTER     INPUTSTR and PROMPTSTR have the ability to send an extra
              carriage return/line feed after a prompt is displayed
              automatically and without the need to make a separate call
              to NEWLINE.

  LFBEFORE    INPUTSTR and PROMPTSTR have the ability to send a carriage
              return/line feed before a prompt is displayed automatically
              and without the need to make a separate call to NEWLINE.

  NEWLINE     INPUTSTR and PROMPTSTR have the ability to send a carriage
              return/line feed after a prompt is displayed automatically
              and without the need to make a separate call to
              NEWLINE.

  NOCLEAR     INPUTSTR and PROMPTSTR statements have the ability to
              automatically clear the default value from the input field
              when the users presses his first key if ANSI is available.
              This is the default mode of operations.  If you don't want
              this to happen, you may use this flag to disable this feature.

  STACKED     INPUTSTR and PROMPTSTR have the ability to allow space
              and semi-colon characters to be input independent of the
              valid character string specified.  This facilitates entering
              stacked commands (commands separated by space or semi-colon
              delimiters) by only requiring a single value be set in the
              input statement instead of having to add " ;" to every valid
              character mask.

  UPCASE      INPUTSTR and PROMPTSTR have the ability to force all input
              characters to uppercase.  This is useful in getting case
              insensitive replies from the user.  If this flag is used,
              you need not pass lowercase valid characters as they will
              be automatically converted at runtime.  If this flag is not
              used and you need to input alphabetic characters, you should
              pass both lowercase and uppercase characters in the valid
              character string.

  WORDWRAP    INPUTSTR and PROMPTSTR have the ability to word wrap from
              one input statement to the next input statement.  If you
              reach the end of the input field PCBoard will automatically
              save the last word from the input field in an internal buffer.
              The next input statement will use that saved word if both
              statements used WORDWRAP.  If the passed variable isn't
              empty or if an input statement is used that doesn't have
              WORDWRAP set then the saved word will not be used.

  YESNO       INPUTSTR and PROMPTSTR have the ability to allow a yes/no
              response to be entered in addition to any valid characters
              passed to the statement.  The extra characters allowed are
              Y/N (or whatever characters were defined for the current
              language; spanish would use S/N, french would use O/N, etc).
              Note that you do not need to pass any valid characters to
              use this flag; regardless of the other legal characters
              the international Y/N characters will be allowed.

 Examples
  AUTO:
  STRING ans
  LET ans = NOCHAR()
  INPUTSTR "Run program now",ans,@X0E,1,"",AUTO+YESNO
  IF (ans = NOCHAR()) END

  ECHODOTS:
  STRING pwd
  PROMPTSTR 148,pwd,12,MASK_PWD(),ECHODOTS+UPCASE
  GETUSER
  IF (pwd <> U_PWD) HANGUP

  ERASELINE:
  STRING s
  INPUTSTR "Press ENTER to continue",s,@X0E,0,"",ERASELINE

  FIELDLEN:
  STRING pwd
  INPUTSTR "Enter id number",pwd,@X0E,4,"0123456789",FIELDLEN+GUIDE
  IF (pwd <> "1234") PRINTLN "Bad id number"

  GUIDE:
  STRING pwd
  INPUTSTR "Enter id number",pwd,@X0E,4,"0123456789",FIELDLEN+GUIDE
  IF (pwd <> "1234") PRINTLN "Bad id number"

  HIGHASCII:
  STRING pwd
  INPUTSTR "Enter password",pwd,@X0E,4,MASK_ASCII(),HIGHASCII
  GETUSER
  IF (pwd <> U_PWD) HANGUP

  LFAFTER:
  STRING pwd
  INPUTSTR "Enter id",pwd,@X0E,4,"0123456789",LFBEFORE+NEWLINE+LFAFTER
  IF (pwd <> "1234") PRINTLN "Bad id number"

  LFBEFORE:
  STRING pwd
  INPUTSTR "Enter id",pwd,@X0E,4,"0123456789",LFBEFORE+NEWLINE+LFAFTER
  IF (pwd <> "1234") PRINTLN "Bad id"

  NEWLINE:
  STRING pwd
  INPUTSTR "Enter id",pwd,@X0E,4,"0123456789",LFBEFORE+NEWLINE+LFAFTER
  IF (pwd <> "1234") PRINTLN "Bad id"

  NOCLEAR:
  STRING cmds
  LET cmds = "QUIT"
  INPUTSTR "Commands",cmds,@X0E,60,MASK_ASCII(),STACKED+NOCLEAR
  TOKENIZE cmds
  LET cmds = GETTOKEN()
  IF (cmds = "QUIT") END
  KBDSTUFF cmds+TOKENSTR()

  STACKED:
  STRING cmds
  INPUTSTR "Commands",cmds,@X0E,60,MASK_ASCII(),STACKED
  TOKENIZE cmds
  LET cmds = GETTOKEN()
  IF (cmds = "QUIT") END
  KBDSTUFF cmds+TOKENSTR()

  UPCASE:
  STRING s
  WHILE (s <> "QUIT") DO
   INPUTSTR "Text",s,@X0E,60,"ABCDEFGHIJKLMNOPQRSTUVWXYZ",UPCASE
   PRINTLN s
  ENDWHILE

  WORDWRAP:
  STRING s(5)
  INTEGER i
  CLS
  FOR i = 1 TO 5
   INPUTSTR "Line"+STRING(i),s(i),@X0E,40,MASK_ASCII(),WORDWRAP+NEWLINE
  NEXT
  CLS
  FOR i = 1 TO 5
   PRINTLN "Line ",i,": ",s(i)
  NEXT

  YESNO:
  STRING ans
  LET ans = NOCHAR()
  INPUTSTR "Run program now",ans,@X0E,1,"",AUTO+YESNO
  IF (ans = NOCHAR()) END

See Also: INPUTSTR PROMPTSTR
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson